import { BaseEntity } from '@cool-midway/core';
import { Column, Entity, Index } from 'typeorm';

/**
 * order模块-订单信息
 */
@Entity('order_info')
export class OrderInfoEntity extends BaseEntity {
  // @Index({ unique: true })
  @Column({ comment: '订单号', length: 50 })
  orderNumber: string;

  @Column({ comment: '用户', length: 50 })
  user: string;

  @Column({ comment: '商品', length: 100 })
  product: string;

  @Column({ comment: '主播id', length: 100, nullable: true })
  anchorId: string;

  @Column({ comment: '主播/产品名称', length: 100 })
  anchorName: string;

  @Column({ comment: '会员Id', length: 100, nullable: true })
  memberId:string

  @Column({ comment: '数量', type: 'int' })
  quantity: number;

  @Column({ comment: '总价', type: 'decimal', precision: 10, scale: 2 })
  totalPrice: number;

  @Column({ comment: '状态 0-待支付 1-已支付 2-已发货 3-已完成 4-已取消', default: 0 })
  status: number;

  @Column({ comment: '支付方式 0-支付宝 1-微信 2-银行卡', default: 0 })
  paymentMethod: number;

  @Column({ comment: '状态 0-图片 1-群聊 2-会员 3-社群 4-金币充值', default: 0 })
  orderType: number;

  @Column({ comment: '收货地址', type: 'text' })
  deliveryAddress: string;

  @Column({ comment: '下单时间', type: 'datetime' })
  orderTime: Date;

  @Column({ comment: '备注', nullable: true })
  remark: string;

  @Column({ comment: '平台订单号' })
  tradeNo: string

  // // 订单类型
  // @Column({ comment: '支付方式 0-h5 1-会员', default: 0 })
  // orderPayType: number;

}
